﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" href="static/h-ui.admin/css/style.css" />


    
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 登录信息列表 <span class="c-gray en">&gt;</span> 勘查信息列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
	 <span class="select-box inline">
		<select name="" class="select">
			<option value="0">全部分类</option>
			<option value="1">未勘查</option>
			<option value="2">勘查中</option>
            <option value="2">已勘查</option>

		</select>
		</span> 日期范围：

		<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate" style="width:120px;">
		
		<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" id="logmax" class="input-text Wdate" style="width:120px;">
		<input type="text" name="" id="" placeholder=" 信息搜索" style="width:250px" class="input-text">
		<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 信息搜索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
        <span style="margin-left:42%;font-size:20px;">
            <b>勘查信息列表</b>
        </span>
        <span class="r">共有数据：<strong id="number"></strong> 条</span> 

	</div>

	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
                    <th width="75">借款人姓名</th>
					<th width="80">借款申请编号</th>
					<th width="80">借款人电话</th>
					<th width="80">勘察员</th>
                    <th colspan="5">房产信息</th>
					<th width="140">申请时间</th>
					<th width="60">勘察状态</th>
					<th width="120">操作</th>
				</tr>
			</thead>
            
			<tbody>
			</tbody>
		</table>
	</div>

</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>


<script type="text/javascript">


$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 不参与排序的列
	]
});
    //初次加载页面
/*资讯-删除*/
function article_del(obj, id) {
    layer.confirm('确认要删除吗？', function (index) {
        $(obj).parents("tr").remove();
        layer.msg('已删除!', { icon: 1, time: 1000 });
        //$.ajax({
        //    type: 'POST',
        //    url: '',
        //    dataType: 'json',
        //    success: function (data) {
        //        $(obj).parents("tr").remove();
        //        layer.msg('已删除!', { icon: 1, time: 1000 });
        //    },
        //    error: function (data) {
        //        console.log(data.msg);
        //    },
        //});
    });
}

/*查看-信息*/
function admin_edit(obj,title, url, id, w, h) {


    //if ($(obj).parents("tr").find(".td-status").text() != "已勘察")
    //{
    //    layer.msg('勘查未完成!请等待', { icon: 2, time: 1000 });
    //    return;
    //}
    var index = layer.open({
        type: 2,
        title: title,
        content: url
    });
    layer.full(index);
}
function admin_start(obj, id) {
    var InfoID = id;
    layer.confirm('确认勘查完成？', function (index) {
        //此处请求后台程序，下方是成功后的前台处理……

        var b = $(obj).parents("tr").find(".td-status").text();

        if (b == "待预约")
        {
            layer.msg('您还没有预约,请先预约', { icon: 2, time: 3000 })
            return;
        }
        else if (b == "已勘察") {
            layer.msg('您已经勘查完成，不可重复提交', { icon: 2, time: 3000 })
            return;
        }
        else {
            $.ajax({
                type: "get",
                url: "http://localhost:41607/api/Entrance/GetPersinalStatusUpd",
                data: {
                    id: InfoID
                },
                success: function (msg) {
                    if (msg) {
                        $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已勘察</span>');
                        layer.msg('勘查完成!', { icon: 6, time: 1000 });
                    }
                    else {
                        layer.msg('提交失败，请联系管理员!', { icon: 2, time: 2000 });

                    }
                }
            })


        }
    });
}




</script> 
    <script>
        $(function () {
            var number = 0;
            var LoginID = sessionStorage.getItem("Login");
            alert(LoginID);
            $.ajax({
                type: "get",
                url: "http://localhost:41607/api/Entrance/GetPersonalSelect",
                data: {
                    id: LoginID,
                    P_stateStart: 0,
                    P_stateEnd:2
                },
                success: function (Msg) {
                    $(Msg).each(function (status, data) {
                        number++;
                        var content = "";
                        content += '<tr class="text-c">';
                        content += '<td>' + data.P_name + '</td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 ' + data.P_id + ' &#39,&#39 Check-in.html &#39,&#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="' + data.P_id + '">' + data.P_id + '</u></td>';
                        content += '<td>' + data.P_phone + '</td>';
                        content += '<td>' + data.P_phone + '</td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 抵押物区位状况 &#39,&#39 Prospecting-info.html &#39,&#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="抵押物区位状况">抵押物区位状况</u></td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 小区状况 &#39,&#39 Prospecting-info.html &#39, &#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="小区状况">小区状况</u></td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 建筑公共部位 &#39,&#39 Prospecting-info.html &#39,&#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="建筑公共部位">建筑公共部位</u></td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 户内部分 &#39,&#39 Prospecting-info.html &#39,&#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="户内部分">户内部分</u></td>';
                        content += '<td class="text-l"><u style="cursor:pointer" class="text-primary" onClick="admin_edit(this,&#39 现场照片 &#39,&#39 Prospecting-info.html &#39,&#39 ' + data.P_id + ' &#39,&#39 800 &#39,&#39 500 &#39)" title="现场照片">现场照片</u></td>';
                        content += '<td>' + data.P_date + '</td>';

                        if (data.P_state == 2)
                        {
                            content += '<td class="td-status"><span class="label label-success radius">' + data.P_status + '</span></td>';
                        }
                        else if (data.P_state == 1)
                        {
                            content += '<td class="td-status"><span class="label label-primary  radius">' + data.P_status + '</span></td>';
                        }
                        else if (data.P_state == 0)
                        {
                            content += '<td class="td-status"><span class="label label-danger  radius">' + data.P_status + '</span></td>';
                        }

                        content += '<td class="f-14 td-manage">';
                        content += '<a onClick="admin_start(this,' + data.P_id + ')" href="javascript:;" title="确认勘查完成" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>';
                        content += '<a style="text-decoration:none" class="ml-5" onClick="article_del(this,"10001")" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>';
                        content += '</td>                   ';
                        content += '</tr>';
                        $("tbody").append(content);
                    })
                    $("#number").html(number);
                }

            })
        })

    </script>
</body>
</html>